{extend name="sitehome@style/base"/}
{block name="resources"}
{/block}
{block name="main"}
<div class="layui-form">
	<div class="nc-quote-box">
        <blockquote class="layui-elem-quote">常规信息</blockquote>
            <div class="layui-form-item">
                <label class="layui-form-label"><span class="required">*</span>文章标题</label>
                <div class="layui-input-inline">
                   <input type="text" name="title" value="{$article_info.title}" lay-verify="title" autocomplete="off" placeholder="" class="layui-input nc-len-long">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">文章短标题</label>
                <div class="layui-input-inline">
                   <input type="text" name="short_title" value="{$article_info.short_title}"  autocomplete="off" placeholder="" class="layui-input nc-len-long">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">文章标签</label>
                <div class="layui-input-inline">
                   <input type="text" name="tag" value="{$article_info.tag}"  autocomplete="off" placeholder="" class="layui-input nc-len-long">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label img-upload-lable">文章标题图片</label>
                <div  class="layui-input-inline article img-upload">
                <div>
                    <input type="hidden" class="layui-input"  name="title_img"  value="{$article_info['image']}"   />
                    <div class="upload-img-block title_img">
                        {if empty($article_info['image'])}
                            <div class="upload-img-box" onclick="uploadSingletitle_img()" >
                                <div>
                                    <i class="add">+</i>
                                </div>
                            </div>
                        {else/}
                            <div class="upload-img-box has-choose-image">
                                <div>
                                    <img src="{:img($article_info['image'])}" layer-src="{:img($article_info['image'])}">
                                </div>
                                <span onclick="uploadSingletitle_img();">修改</span>
                            </div>
                        {/if}
                    </div>
                    </div>
                    {:hook("fileUpload", ["name" => "title_img", "file_type" => "IMAGE", "type" => "common"], '', true)}
                    <div style="clear: both"></div>
               </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">文章作者</label>
                <div class="layui-input-inline">
                   <input type="text" name="author" value="{$article_info.author}" autocomplete="off" placeholder="" class="layui-input nc-len-long">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">文章来源</label>
                <div class="layui-input-inline">
                   <input type="text" name="source" value="{$article_info.source}"  autocomplete="off" placeholder="" class="layui-input nc-len-long">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">文章来源链接</label>
                <div class="layui-input-inline">
                   <input type="text" name="url" value="{$article_info.url}"  autocomplete="off" placeholder="" class="layui-input nc-len-long">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><span class="required">*</span>文章分类</label>
                <div class="layui-input-inline">
                   <select name="category_id" lay-verify="category_id" >
                        <option value="0">请选择</option>
                         {volist name="list_tree" id="vo"}
                            <option value="{$vo.category_id}" {if condition="$vo.category_id eq $article_info.category_id"}selected{/if}>{$vo.category_name}</option>
                            {volist name="vo['child_list']" id="v1"}
                            <option value="{$v1.category_id}" {if condition="$v1.category_id eq $article_info.category_id"}selected{/if}>&nbsp;&nbsp;&nbsp;&nbsp;{$v1.category_name}</option>
                            {/volist}
                         {/volist}
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">文章关键字</label>
                <div class="layui-input-inline">
                   <input type="text" name="keyword" value="{$article_info.keyword}" autocomplete="off" placeholder="" class="layui-input nc-len-long">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">文章摘要</label>
                <div class="layui-input-inline">
                   <textarea name="summary" autocomplete="off" placeholder=""  class="layui-textarea nc-len-long">{$article_info.summary}</textarea>
                </div>
            </div>
	</div>
	
	<div class="nc-quote-box">
        <blockquote class="layui-elem-quote">文章内容</blockquote>
        <div class="layui-form-item">
            <label class="layui-form-label">文章内容</label>
            <div class="layui-input-inline">
                <textarea id="editor"></textarea>
            </div>
        </div>

        <div  class="layui-form-item">
            <label class="layui-form-label">文章附件</label>
            <div class="layui-input-inline  article">
                 {:hook("fileUpload", ['name' => 'article', 'type' => 'common', 'file_type' => 'ATTACHMENT'], '', true)}
                 <div>
                    <button type="button" class="layui-btn layui-btn-sm" onclick="uploadEnclosurearticle()">上传附件</button>
                 </div>
                 <input type="hidden" name="attachment_path" value="{$article_info.attachment_path}"  autocomplete="off" placeholder="" class="layui-input nc-len-long" style="margin-top:10px;">
            </div>
        </div>
	</div>
	
	<div class="nc-quote-box">
        <blockquote class="layui-elem-quote">文章阐述</blockquote>
        <div class="layui-form-item">
            <label class="layui-form-label">是否推荐</label>
            <div class="layui-input-inline">
                  <input type="checkbox" name="commend_flag" value="1" lay-skin="switch" {if condition="$article_info.commend_flag eq 1"}checked{/if}>
            </div>
        </div>

        <div  class="layui-form-item">
            <label class="layui-form-label">是否允许评论</label>
            <div class="layui-input-inline">
                  <input type="checkbox"  name="comment_flag" value="1" lay-skin="switch" {if condition="$article_info.comment_flag eq 1"}checked{/if}>
            </div>
        </div>

        <div  class="layui-form-item">
            <label class="layui-form-label">文章排序</label>
            <div class="layui-input-inline">
                  <input type="number" name="sort" value="{$article_info.sort}"  autocomplete="off" placeholder="" class="layui-input nc-len-short">
            </div>
        </div>

        <div  class="layui-form-item">
            <label class="layui-form-label">文章点击量</label>
            <div class="layui-input-inline">
                  <input type="number" name="click" value="{$article_info.click}"  autocomplete="off" placeholder="" class="layui-input nc-len-short">
            </div>
            <span class="layui-form-mid">次</span>
        </div>
        <div  class="layui-form-item">
            <label class="layui-form-label">文章评论数</label>
            <div class="layui-input-inline">
                  <input type="number" name="comment_count" value="{$article_info.comment_count}" autocomplete="off" placeholder="" class="layui-input nc-len-short">
            </div>
            <span class="layui-form-mid">次</span>
        </div>
        <div  class="layui-form-item">
            <label class="layui-form-label">文章分享数</label>
            <div class="layui-input-inline">
                  <input type="number" name="share_count" value="{$article_info.share_count}" autocomplete="off" placeholder="" class="layui-input nc-len-short">
            </div>
            <span class="layui-form-mid">次</span>
        </div>
        <input type="hidden" value="{$article_info.article_id}" name="article_id"/>
        <div class="nc-form-row">
            <button class="layui-btn" lay-submit="" lay-filter="btnArticle" type="button">保存</button>
            <button class="layui-btn layui-btn-primary" onclick="window.location.href = window.history.go(-1);">取消</button>
        </div>
	</div>
	
</div>
{/block}
{block name="script"}
<script>
var editor = new Editor("editor",{});
editor.setContent('{$article_info["content"]}');
</script>
<script src="ARTICLE_JS/article.js"></script>
{/block}